#coding:utf-8

from django.db import models
from django.contrib import  admin

# Create your models here.

class Category(models.Model):
    name = models.CharField(u'类别',max_length=16)
    def __unicode__(self):
        return self.name
    class Meta:
        verbose_name = u'类别'
        verbose_name_plural = u'类别'

class Media(models.Model):
    name = models.CharField(u'名称',max_length=50)
    url = models.URLField(u'网址')
    category = models.ForeignKey(Category)
    class Meta:
        verbose_name = u'多媒体'
        verbose_name_plural = u'多媒体'
    def __unicode__(self):
        return self.name
admin.site.register(Category)
admin.site.register(Media)